package de.hsb.ai.agent.misterx.pathheuristic;

import java.util.ArrayList;
import de.hsb.ai.agent.misterx.brain.Brain;
import de.hsb.ai.agent.misterx.brain.GraphAnalyser.DangerZone;
import de.hsb.ai.agent.misterx.pathfinding.Node;


public class DangerzoneHeuristic implements INodeHeuristic {

	public DangerzoneHeuristic() {
		
	}
	
	
	/**
	 * 
	 */
	@Override
	public int getHeuristik(Node startNode, Node endNode, Node currentNode) {
		int heuristic = 0;
		
		ArrayList<DangerZone> dangerZones = Brain.GRAPHANALYSER.getDangerZonesByNodeIndex(currentNode._index);
		
		for(DangerZone dangerZone : dangerZones) {
			if(Brain.getOwnAID().equals(dangerZone._aid) == false) {
					
				int radius = dangerZone._radius;
				
				if(radius == 3) heuristic += 50;
				if(radius == 2) heuristic += 200;
				if(radius == 1) heuristic += 500;
				if(radius == 0) heuristic += 1000;
			}
		}
		
		return heuristic;
	}
	
	
	/**
	 * 
	 */
	@Override
	public void update() {
		
	}

}
